package com.tuyue.police.pojo;

import javax.persistence.*;

/**
 * @Author: 王金海
 * @Description: 规则
 * @Date: Created by Administrator on 2018/3/13.
 * @Modified By:
 */
@Entity
public class Rule {
    private long ruleId;
    private long ruleUserId;
    private long ruleDispenseId;
    private String ruleName;
    //转发方式名称
    private String ruleDispenseName;
    @Transient
    public String getRuleDispenseName() {
        return ruleDispenseName;
    }

    public void setRuleDispenseName(String ruleDispenseName) {
        this.ruleDispenseName = ruleDispenseName;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "rule_id")
    public long getRuleId() {
        return ruleId;
    }

    public void setRuleId(long ruleId) {
        this.ruleId = ruleId;
    }

    @Basic
    @Column(name = "rule_user_id")
    public long getRuleUserId() {
        return ruleUserId;
    }

    public void setRuleUserId(long ruleUserId) {
        this.ruleUserId = ruleUserId;
    }


    @Basic
    @Column(name = "rule_dispense_id")
    public long getRuleDispenseId() {
        return ruleDispenseId;
    }

    public void setRuleDispenseId(long ruleDispenseId) {
        this.ruleDispenseId = ruleDispenseId;
    }
    @Basic
    @Column(name = "rule_name")
    public String getRuleName() {
        return ruleName;
    }

    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Rule rule = (Rule) o;

        if (ruleId != rule.ruleId) return false;
        if (ruleUserId != rule.ruleUserId) return false;
        if (ruleDispenseId != rule.ruleDispenseId) return false;
        if (ruleName != null ? !ruleName.equals(rule.ruleName) : rule.ruleName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (ruleId ^ (ruleId >>> 32));
        result = 31 * result + (int) (ruleUserId ^ (ruleUserId >>> 32));
        result = 31 * result + (int) (ruleDispenseId ^ (ruleDispenseId >>> 32));
        result = 31 * result + (ruleName != null ? ruleName.hashCode() : 0);
        return result;
    }
}
